<template>
  <div>
    <tab-list
      v-show="tabListflag"
      @add="showAddOrModify"
      @modify="showAddOrModify"
      :customerForm="customerForm"
      ref="tabList">
    </tab-list>
    <data-add-or-modify
      v-show="addOrModifyflag"
      @list="showTabList"
      ref="addOrModify">
    </data-add-or-modify>
  </div>
</template>

<script>
import tabList from './tabList'
import dataAddOrModify from './addOrModify'
export default {
  name:'Mm30CheckObject',
  props:{
    customerForm:{
      type:Object,
      default:{}
    }
  },
  data() {
    return {
      tabListflag: true,
      addOrModifyflag:false
    }
  },
  components: {
    tabList,
    dataAddOrModify
  },
  methods: {
    showAddOrModify(data){
      this.tabListflag=false
      this.addOrModifyflag=true
      this.$refs.addOrModify.show(data)
    },
    showTabList(){
      this.tabListflag=true
      this.addOrModifyflag=false
      this.$nextTick(()=> {
        this.$refs.tabList.getList()
      })
    }
  }
}
</script>
